/* USER CODE BEGIN Header */
/**
 ******************************************************************************
 * @file           : usbd_custom_hid_if.c
 * @version        : v1.0_Cube
 * @brief          : USB Device Custom HID interface file.
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2022 STMicroelectronics.
 * All rights reserved.
 *
 * This software is licensed under terms that can be found in the LICENSE file
 * in the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 *
 ******************************************************************************
 */
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "usbd_custom_hid_if.h"

/* USER CODE BEGIN INCLUDE */

/* USER CODE END INCLUDE */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/

/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/

extern void USB_Control_Out_Callback(void *temp);
extern void USB_Wheel_Out_Callback(void *temp);
extern void Froce_Callback(uint8_t Flag, int16_t Value);

/* USER CODE END PV */

/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
 * @brief Usb device.
 * @{
 */

/** @addtogroup USBD_CUSTOM_HID
 * @{
 */

/** @defgroup USBD_CUSTOM_HID_Private_TypesDefinitions USBD_CUSTOM_HID_Private_TypesDefinitions
 * @brief Private types.
 * @{
 */

/* USER CODE BEGIN PRIVATE_TYPES */

/* USER CODE END PRIVATE_TYPES */

/**
 * @}
 */

/** @defgroup USBD_CUSTOM_HID_Private_Defines USBD_CUSTOM_HID_Private_Defines
 * @brief Private defines.
 * @{
 */

/* USER CODE BEGIN PRIVATE_DEFINES */

/* USER CODE END PRIVATE_DEFINES */

/**
 * @}
 */

/** @defgroup USBD_CUSTOM_HID_Private_Macros USBD_CUSTOM_HID_Private_Macros
 * @brief Private macros.
 * @{
 */

/* USER CODE BEGIN PRIVATE_MACRO */

/* USER CODE END PRIVATE_MACRO */

/**
 * @}
 */

/** @defgroup USBD_CUSTOM_HID_Private_Variables USBD_CUSTOM_HID_Private_Variables
 * @brief Private variables.
 * @{
 */

/** Usb HID report descriptor. */
__ALIGN_BEGIN static uint8_t CUSTOM_HID_ReportDesc_FS[USBD_CUSTOM_HID_REPORT_DESC_SIZE] __ALIGN_END =
    {
        /* USER CODE BEGIN 0 */
        0x05, 0x01,                   // Usage Page (Generic Desktop Ctrls)
        0x09, 0x04,                   // Usage (Joystick)
        0xA1, 0x01,                   // Collection (Application)
        0x85, 0x01,                   //   Report ID (1)
        0x09, 0x39,                   //   Usage (Hat switch)
        0x15, 0x01,                   //   Logical Minimum (1)
        0x25, 0x08,                   //   Logical Maximum (8)
        0x75, 0x08,                   //   Report Size (8)
        0x95, 0x01,                   //   Report Count (1)
        0x81, 0x02,                   //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x05, 0x09,                   //   Usage Page (Button)
        0x19, 0x01,                   //   Usage Minimum (0x01)
        0x29, 0x10,                   //   Usage Maximum (0x10)
        0x15, 0x00,                   //   Logical Minimum (0)
        0x25, 0x01,                   //   Logical Maximum (1)
        0x75, 0x01,                   //   Report Size (1)
        0x95, 0x10,                   //   Report Count (16)
        0x81, 0x02,                   //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x05, 0x01,                   //   Usage Page (Generic Desktop Ctrls)
        0x09, 0x33,                   //   Usage (Rx)
        0x09, 0x34,                   //   Usage (Ry)
        0x16, 0x00, 0x00,             //   Logical Minimum (0)
        0x27, 0xFF, 0xFF, 0x00, 0x00, //   Logical Maximum (65534)
        0x35, 0x00,                   //   Physical Minimum (0)
        0x47, 0xFF, 0xFF, 0x00, 0x00, //   Physical Maximum (65534)
        0x75, 0x10,                   //   Report Size (16)
        0x95, 0x02,                   //   Report Count (2)
        0x81, 0x02,                   //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x09, 0x30,                   //   Usage (X)
        0x09, 0x31,                   //   Usage (Y)
        0x09, 0x38,                   //   Usage (Wheel)
        0x16, 0x00, 0x80,             //   Logical Minimum (-32768)
        0x26, 0xFF, 0x7F,             //   Logical Maximum (32767)
        0x36, 0x00, 0x80,             //   Physical Minimum (-32768)
        0x46, 0xFF, 0x7F,             //   Physical Maximum (32767)
        0x75, 0x10,                   //   Report Size (16)
        0x95, 0x03,                   //   Report Count (3)
        0x81, 0x02,                   //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x05, 0x02,                   //   Usage Page (Sim Ctrls)
        0x09, 0xBB,                   //   Usage (Throttle)
        0x09, 0xC5,                   //   Usage (Brake)
        0x09, 0xC7,
        0x16, 0x00, 0x00,             //   Logical Minimum (0)
        0x27, 0xFF, 0xFF, 0x00, 0x00, //   Logical Maximum (65534)
        0x35, 0x00,                   //   Physical Minimum (0)
        0x47, 0xFF, 0xFF, 0x00, 0x00, //   Physical Maximum (65534)
        0x75, 0x10,                   //   Report Size (16)
        0x95, 0x03,                   //   Report Count (2)
        0x81, 0x02,                   //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

        0x05, 0x0F,                   //   Usage Page (PID Page)
        0x09, 0x92,                   //   Usage (0x92)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x02,                   //     Report ID (2)
        0x09, 0x9F,                   //     Usage (0x9F)
        0x09, 0xA0,                   //     Usage (0xA0)
        0x09, 0xA4,                   //     Usage (0xA4)
        0x09, 0xA5,                   //     Usage (0xA5)
        0x09, 0xA6,                   //     Usage (0xA6)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x25, 0x01,                   //     Logical Maximum (1)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x45, 0x01,                   //     Physical Maximum (1)
        0x75, 0x01,                   //     Report Size (1)
        0x95, 0x05,                   //     Report Count (5)
        0x81, 0x02,                   //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x95, 0x03,                   //     Report Count (3)
        0x81, 0x03,                   //     Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x09, 0x94,                   //     Usage (0x94)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x25, 0x01,                   //     Logical Maximum (1)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x45, 0x01,                   //     Physical Maximum (1)
        0x75, 0x01,                   //     Report Size (1)
        0x95, 0x01,                   //     Report Count (1)
        0x81, 0x02,                   //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x07,                   //     Report Size (7)
        0x95, 0x01,                   //     Report Count (1)
        0x81, 0x02,                   //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
        0xC0,                         //   End Collection
        0x09, 0x21,                   //   Usage (0x21)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x01,                   //     Report ID (1)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x25,                   //     Usage (0x25)
        0xA1, 0x02,                   //     Collection (Logical)
        0x09, 0x26,                   //       Usage (0x26)
        0x09, 0x27,                   //       Usage (0x27)
        0x09, 0x30,                   //       Usage (0x30)
        0x09, 0x31,                   //       Usage (0x31)
        0x09, 0x32,                   //       Usage (0x32)
        0x09, 0x33,                   //       Usage (0x33)
        0x09, 0x34,                   //       Usage (0x34)
        0x09, 0x40,                   //       Usage (0x40)
        0x09, 0x41,                   //       Usage (0x41)
        0x09, 0x42,                   //       Usage (0x42)
        0x09, 0x43,                   //       Usage (0x43)
        0x25, 0x0B,                   //       Logical Maximum (11)
        0x15, 0x01,                   //       Logical Minimum (1)
        0x35, 0x01,                   //       Physical Minimum (1)
        0x45, 0x0B,                   //       Physical Maximum (11)
        0x75, 0x08,                   //       Report Size (8)
        0x95, 0x01,                   //       Report Count (1)
        0x91, 0x00,                   //       Output (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x09, 0x50,                   //     Usage (0x50)
        0x09, 0x54,                   //     Usage (0x54)
        0x09, 0x51,                   //     Usage (0x51)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0x10, 0x27,             //     Logical Maximum (10000)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x66, 0x03, 0x10,             //     Unit (System: English Linear, Time: Seconds)
        0x55, 0xFD,                   //     Unit Exponent
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x03,                   //     Report Count (3)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x55, 0x00,                   //     Unit Exponent (0)
        0x66, 0x00, 0x00,             //     Unit (None)
        0x09, 0x52,                   //     Usage (0x52)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0x10, 0x27,             //     Logical Maximum (10000)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x53,                   //     Usage (0x53)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x08,                   //     Logical Maximum (8)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x08,                   //     Physical Maximum (8)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x55,                   //     Usage (0x55)
        0xA1, 0x02,                   //     Collection (Logical)
        0x05, 0x01,                   //       Usage Page (Generic Desktop Ctrls)
        0x09, 0x30,                   //       Usage (X)
        0x09, 0x31,                   //       Usage (Y)
        0x15, 0x00,                   //       Logical Minimum (0)
        0x25, 0x01,                   //       Logical Maximum (1)
        0x75, 0x01,                   //       Report Size (1)
        0x95, 0x02,                   //       Report Count (2)
        0x91, 0x02,                   //       Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x05, 0x0F,                   //     Usage Page (PID Page)
        0x09, 0x56,                   //     Usage (0x56)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x95, 0x05,                   //     Report Count (5)
        0x91, 0x03,                   //     Output (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x57,                   //     Usage (0x57)
        0xA1, 0x02,                   //     Collection (Logical)
        0x0B, 0x01, 0x00, 0x0A, 0x00, //       Usage (0x0A0001)
        0x0B, 0x02, 0x00, 0x0A, 0x00, //       Usage (0x0A0002)
        0x66, 0x14, 0x00,             //       Unit (System: English Rotation, Length: Centimeter)
        0x55, 0xFE,                   //       Unit Exponent
        0x15, 0x00,                   //       Logical Minimum (0)
        0x26, 0xFF, 0x00,             //       Logical Maximum (255)
        0x35, 0x00,                   //       Physical Minimum (0)
        0x46, 0x68, 0x01,             //       Physical Maximum (360)
        0x66, 0x00, 0x00,             //       Unit (None)
        0x75, 0x08,                   //       Report Size (8)
        0x95, 0x02,                   //       Report Count (2)
        0x91, 0x02,                   //       Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x55, 0x00,                   //       Unit Exponent (0)
        0x66, 0x00, 0x00,             //       Unit (None)
        0xC0,                         //     End Collection
        // 0x05, 0x0F,                   //     Usage Page (PID Page)
        // 0x09, 0xA7,                   //     Usage (0xA7)
        // 0x66, 0x03, 0x10,             //     Unit (System: English Linear, Time: Seconds)
        // 0x55, 0xFD,                   //     Unit Exponent
        // 0x15, 0x00,                   //     Logical Minimum (0)
        // 0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        // 0x35, 0x00,                   //     Physical Minimum (0)
        // 0x46, 0xFF, 0x7F,             //     Physical Maximum (32767)
        // 0x75, 0x10,                   //     Report Size (16)
        // 0x95, 0x01,                   //     Report Count (1)
        // 0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        // 0x66, 0x00, 0x00,             //     Unit (None)
        // 0x55, 0x00,                   //     Unit Exponent (0)
        0xC0,                         //   End Collection
        0x05, 0x0F,                   //   Usage Page (PID Page)
        0x09, 0x5A,                   //   Usage (0x5A)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x02,                   //     Report ID (2)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x5B,                   //     Usage (0x5B)
        0x09, 0x5D,                   //     Usage (0x5D)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x00,             //     Logical Maximum (255)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x95, 0x02,                   //     Report Count (2)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x5C,                   //     Usage (0x5C)
        0x09, 0x5E,                   //     Usage (0x5E)
        0x66, 0x03, 0x10,             //     Unit (System: English Linear, Time: Seconds)
        0x55, 0xFD,                   //     Unit Exponent
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x46, 0xFF, 0x7F,             //     Physical Maximum (32767)
        0x75, 0x10,                   //     Report Size (16)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x45, 0x00,                   //     Physical Maximum (0)
        0x66, 0x00, 0x00,             //     Unit (None)
        0x55, 0x00,                   //     Unit Exponent (0)
        0xC0,                         //   End Collection
        0x09, 0x5F,                   //   Usage (0x5F)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x03,                   //     Report ID (3)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x23,                   //     Usage (0x23)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x25, 0x01,                   //     Logical Maximum (1)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x45, 0x01,                   //     Physical Maximum (1)
        0x75, 0x04,                   //     Report Size (4)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x58,                   //     Usage (0x58)
        0xA1, 0x02,                   //     Collection (Logical)
        0x0B, 0x01, 0x00, 0x0A, 0x00, //       Usage (0x0A0001)
        0x0B, 0x02, 0x00, 0x0A, 0x00, //       Usage (0x0A0002)
        0x75, 0x02,                   //       Report Size (2)
        0x95, 0x02,                   //       Report Count (2)
        0x91, 0x02,                   //       Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x15, 0x80,                   //     Logical Minimum (-128)
        0x25, 0x7F,                   //     Logical Maximum (127)
        0x36, 0xF0, 0xD8,             //     Physical Minimum (-10000)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x09, 0x60,                   //     Usage (0x60)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x36, 0xF0, 0xD8,             //     Physical Minimum (-10000)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x09, 0x61,                   //     Usage (0x61)
        0x09, 0x62,                   //     Usage (0x62)
        0x95, 0x02,                   //     Report Count (2)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x00,             //     Logical Maximum (255)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x09, 0x63,                   //     Usage (0x63)
        0x09, 0x64,                   //     Usage (0x64)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x02,                   //     Report Count (2)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x65,                   //     Usage (0x65)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x6E,                   //   Usage (0x6E)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x04,                   //     Report ID (4)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x70,                   //     Usage (0x70)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x00,             //     Logical Maximum (255)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x6F,                   //     Usage (0x6F)
        0x15, 0x80,                   //     Logical Minimum (-128)
        0x25, 0x7F,                   //     Logical Maximum (127)
        0x36, 0xF0, 0xD8,             //     Physical Minimum (-10000)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x71,                   //     Usage (0x71)
        0x66, 0x14, 0x00,             //     Unit (System: English Rotation, Length: Centimeter)
        0x55, 0xFE,                   //     Unit Exponent
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x00,             //     Logical Maximum (255)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x47, 0xA0, 0x8C, 0x00, 0x00, //     Physical Maximum (35999)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x72,                   //     Usage (0x72)
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x46, 0xFF, 0x7F,             //     Physical Maximum (32767)
        0x66, 0x03, 0x10,             //     Unit (System: English Linear, Time: Seconds)
        0x55, 0xFD,                   //     Unit Exponent
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x66, 0x00, 0x00,             //     Unit (None)
        0x55, 0x00,                   //     Unit Exponent (0)
        0xC0,                         //   End Collection
        0x09, 0x73,                   //   Usage (0x73)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x05,                   //     Report ID (5)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x70,                   //     Usage (0x70)
        0x16, 0x04, 0x80,             //     Logical Minimum (-32764)
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x36, 0xF0, 0xD8,             //     Physical Minimum (-10000)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x74,                   //   Usage (0x74)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x06,                   //     Report ID (6)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x75,                   //     Usage (0x75)
        0x09, 0x76,                   //     Usage (0x76)
        0x15, 0x80,                   //     Logical Minimum (-128)
        0x25, 0x7F,                   //     Logical Maximum (127)
        0x36, 0xF0, 0xD8,             //     Physical Minimum (-10000)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x02,                   //     Report Count (2)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x66,                   //   Usage (0x66)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x07,                   //     Report ID (7)
        0x05, 0x01,                   //     Usage Page (Generic Desktop Ctrls)
        0x09, 0x30,                   //     Usage (X)
        0x09, 0x31,                   //     Usage (Y)
        0x16, 0x00, 0x80,             //     Logical Minimum (-32768)
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x02,                   //     Report Count (2)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x05, 0x0F,                   //   Usage Page (PID Page)
        0x09, 0x77,                   //   Usage (0x77)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x08,                   //     Report ID (8)
        0x09, 0x22,                   //     Usage (0x22)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x78,                   //     Usage (0x78)
        0xA1, 0x02,                   //     Collection (Logical)
        0x09, 0x79,                   //       Usage (0x79)
        0x09, 0x7A,                   //       Usage (0x7A)
        0x09, 0x7B,                   //       Usage (0x7B)
        0x15, 0x01,                   //       Logical Minimum (1)
        0x25, 0x03,                   //       Logical Maximum (3)
        0x75, 0x08,                   //       Report Size (8)
        0x95, 0x01,                   //       Report Count (1)
        0x91, 0x00,                   //       Output (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x09, 0x7C,                   //     Usage (0x7C)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0xFF, 0x7F,             //     Physical Maximum (32767)
        0x75, 0x10,                   //     Report Size (16)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x90,                   //   Usage (0x90)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x09,                   //     Report ID (9)
        0x09, 0x22,                   //     Usage (0x22)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x96,                   //   Usage (0x96)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x0A,                   //     Report ID (10)
        0x09, 0x97,                   //     Usage (0x97)
        0x09, 0x98,                   //     Usage (0x98)
        0x09, 0x99,                   //     Usage (0x99)
        0x09, 0x9A,                   //     Usage (0x9A)
        0x09, 0x9B,                   //     Usage (0x9B)
        0x09, 0x9C,                   //     Usage (0x9C)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x25, 0x06,                   //     Logical Maximum (6)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x00,                   //     Output (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x7D,                   //   Usage (0x7D)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x0B,                   //     Report ID (11)
        0x09, 0x7E,                   //     Usage (0x7E)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x7F,             //     Logical Maximum (32767)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0x10, 0x27,             //     Physical Maximum (10000)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0x91, 0x02,                   //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x05, 0x01,                   //   Usage (0x01)
        0xA1, 0x02,                   //   Collection (Logical)
        0x09, 0x00,                   //     Usage (0x86)
        0x85, 0x0C,                   //     Report ID (12)
        0x26, 0xFF, 0x00,             //     Logical Maximum (65535)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x13,                   //     Report Count (19)
        0x92, 0x02, 0x01,             //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile,Buffered Bytes)
        0xC0,                         //   End Collection
        0xA1, 0x02,                   //   Collection (Logical)
        0x09, 0x00,                   //     Usage (0x86)
        0x85, 0x0D,                   //     Report ID (13)
        0x26, 0xFF, 0x00,             //     Logical Maximum (65535)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x13,                   //     Report Count (19)
        0x92, 0x02, 0x01,             //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile,Buffered Bytes)
        0xC0,                         //   End Collection
        0xA1, 0x02,                   //   Collection (Logical)
        0x09, 0x00,                   //     Usage (0x86)
        0x85, 0x0E,                   //     Report ID (14)
        0x26, 0xFF, 0x00,             //     Logical Maximum (65535)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x13,                   //     Report Count (19)
        0x92, 0x02, 0x01,             //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile,Buffered Bytes)
        0xC0,                         //   End Collection
        0x05, 0x0F,                   //   PID Usage
        0x09, 0xAB,                   //   Usage (0xAB)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x01,                   //     Report ID (1)
        0x09, 0x25,                   //     Usage (0x25)
        0xA1, 0x02,                   //     Collection (Logical)
        0x09, 0x26,                   //       Usage (0x26)
        0x09, 0x27,                   //       Usage (0x27)
        0x09, 0x30,                   //       Usage (0x30)
        0x09, 0x31,                   //       Usage (0x31)
        0x09, 0x32,                   //       Usage (0x32)
        0x09, 0x33,                   //       Usage (0x33)
        0x09, 0x34,                   //       Usage (0x34)
        0x09, 0x40,                   //       Usage (0x40)
        0x09, 0x41,                   //       Usage (0x41)
        0x09, 0x42,                   //       Usage (0x42)
        0x09, 0x43,                   //       Usage (0x43)
        0x25, 0x0B,                   //       Logical Maximum (11)
        0x15, 0x01,                   //       Logical Minimum (1)
        0x35, 0x01,                   //       Physical Minimum (1)
        0x45, 0x0B,                   //       Physical Maximum (11)
        0x75, 0x08,                   //       Report Size (8)
        0x95, 0x01,                   //       Report Count (1)
        0xB1, 0x00,                   //       Feature (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x05, 0x01,                   //     Usage Page (Generic Desktop Ctrls)
        0x09, 0x3B,                   //     Usage (Byte Count)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x26, 0xFF, 0x01,             //     Logical Maximum (511)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x46, 0xFF, 0x01,             //     Physical Maximum (511)
        0x75, 0x0A,                   //     Report Size (10)
        0x95, 0x01,                   //     Report Count (1)
        0xB1, 0x02,                   //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x75, 0x06,                   //     Report Size (6)
        0xB1, 0x01,                   //     Feature (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x05, 0x0F,                   //   Usage Page (PID Page)
        0x09, 0x89,                   //   Usage (0x89)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x02,                   //     Report ID (2)
        0x09, 0x22,                   //     Usage (0x22)
        0x25, 0x28,                   //     Logical Maximum (40)
        0x15, 0x01,                   //     Logical Minimum (1)
        0x35, 0x01,                   //     Physical Minimum (1)
        0x45, 0x28,                   //     Physical Maximum (40)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0xB1, 0x02,                   //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x8B,                   //     Usage (0x8B)
        0xA1, 0x02,                   //     Collection (Logical)
        0x09, 0x8C,                   //       Usage (0x8C)
        0x09, 0x8D,                   //       Usage (0x8D)
        0x09, 0x8E,                   //       Usage (0x8E)
        0x25, 0x03,                   //       Logical Maximum (3)
        0x15, 0x01,                   //       Logical Minimum (1)
        0x35, 0x01,                   //       Physical Minimum (1)
        0x45, 0x03,                   //       Physical Maximum (3)
        0x75, 0x08,                   //       Report Size (8)
        0x95, 0x01,                   //       Report Count (1)
        0xB1, 0x00,                   //       Feature (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //     End Collection
        0x09, 0xAC,                   //     Usage (0xAC)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x27, 0xFF, 0xFF, 0x00, 0x00, //     Logical Maximum (65534)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x47, 0xFF, 0xFF, 0x00, 0x00, //     Physical Maximum (65534)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0xB1, 0x00,                   //     Feature (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        0x09, 0x7F,                   //   Usage (0x7F)
        0xA1, 0x02,                   //   Collection (Logical)
        0x85, 0x03,                   //     Report ID (3)
        0x09, 0x80,                   //     Usage (0x80)
        0x75, 0x10,                   //     Report Size (16)
        0x95, 0x01,                   //     Report Count (1)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x27, 0xFF, 0xFF, 0x00, 0x00, //     Logical Maximum (65534)
        0x47, 0xFF, 0xFF, 0x00, 0x00, //     Physical Maximum (65534)
        0xB1, 0x02,                   //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0x83,                   //     Usage (0x83)
        0x25, 0x7F,                   //     Logical Maximum (127)
        0x45, 0x7F,                   //     Physical Maximum (127)
        0x75, 0x08,                   //     Report Size (8)
        0x95, 0x01,                   //     Report Count (1)
        0xB1, 0x02,                   //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x09, 0xA9,                   //     Usage (0xA9)
        0x09, 0xAA,                   //     Usage (0xAA)
        0x75, 0x01,                   //     Report Size (1)
        0x95, 0x02,                   //     Report Count (2)
        0x15, 0x00,                   //     Logical Minimum (0)
        0x25, 0x01,                   //     Logical Maximum (1)
        0x35, 0x00,                   //     Physical Minimum (0)
        0x45, 0x01,                   //     Physical Maximum (1)
        0xB1, 0x02,                   //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0x75, 0x06,                   //     Report Size (6)
        0x95, 0x01,                   //     Report Count (1)
        0xB1, 0x03,                   //     Feature (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
        0xC0,                         //   End Collection
        // 1174 bytes
        /* USER CODE END 0 */
        0xC0 /*     END_COLLECTION	             */
};

/* USER CODE BEGIN PRIVATE_VARIABLES */

/* USER CODE END PRIVATE_VARIABLES */

/**
 * @}
 */

/** @defgroup USBD_CUSTOM_HID_Exported_Variables USBD_CUSTOM_HID_Exported_Variables
 * @brief Public variables.
 * @{
 */
extern USBD_HandleTypeDef hUsbDeviceFS;

/* USER CODE BEGIN EXPORTED_VARIABLES */

/* USER CODE END EXPORTED_VARIABLES */
/**
 * @}
 */

/** @defgroup USBD_CUSTOM_HID_Private_FunctionPrototypes USBD_CUSTOM_HID_Private_FunctionPrototypes
 * @brief Private functions declaration.
 * @{
 */

static int8_t CUSTOM_HID_Init_FS(void);
static int8_t CUSTOM_HID_DeInit_FS(void);
static int8_t CUSTOM_HID_OutEvent_FS(uint8_t event_idx, uint8_t state);

/**
 * @}
 */

USBD_CUSTOM_HID_ItfTypeDef USBD_CustomHID_fops_FS =
    {
        CUSTOM_HID_ReportDesc_FS,
        CUSTOM_HID_Init_FS,
        CUSTOM_HID_DeInit_FS,
        CUSTOM_HID_OutEvent_FS};

/** @defgroup USBD_CUSTOM_HID_Private_Functions USBD_CUSTOM_HID_Private_Functions
 * @brief Private functions.
 * @{
 */

/* Private functions ---------------------------------------------------------*/

/**
 * @brief  Initializes the CUSTOM HID media low layer
 * @retval USBD_OK if all operations are OK else USBD_FAIL
 */
static int8_t CUSTOM_HID_Init_FS(void)
{
  /* USER CODE BEGIN 4 */
  return (USBD_OK);
  /* USER CODE END 4 */
}

/**
 * @brief  DeInitializes the CUSTOM HID media low layer
 * @retval USBD_OK if all operations are OK else USBD_FAIL
 */
static int8_t CUSTOM_HID_DeInit_FS(void)
{
  /* USER CODE BEGIN 5 */
  return (USBD_OK);
  /* USER CODE END 5 */
}

/**
 * @brief  Manage the CUSTOM HID class events
 * @param  event_idx: Event index
 * @param  state: Event state
 * @retval USBD_OK if all operations are OK else USBD_FAIL
 */
static int8_t CUSTOM_HID_OutEvent_FS(uint8_t event_idx, uint8_t state)
{
  /* USER CODE BEGIN 6 */
  USBD_CUSTOM_HID_HandleTypeDef *hhid = (USBD_CUSTOM_HID_HandleTypeDef *)hUsbDeviceFS.pClassDataCmsit[hUsbDeviceFS.classId];
  UNUSED(event_idx);
  UNUSED(state);
  switch (event_idx)
  {
  case 0x01:
    SetEffect(hhid->Report_buf[1], hhid->Report_buf);
    break;
  case 0x05:
    Froce_Callback(0x01, hhid->Report_buf[2] + (hhid->Report_buf[3] << 8));
    break;
  case 0x08:
    switch (hhid->Report_buf[2])
    {
    case 1:
      // Op Effect Start
      break;
    case 2:
      // Op Effect Start Solo
      break;
    case 3:
      // Op Effect Stop
      Froce_Callback(0, 0);
      break;
    }
    break;
  case 0x0A:
    switch (hhid->Report_buf[1])
    {
    case 1:
      // DC Enable
      break;
    case 2:
      // DC Disable
      break;
    case 3:
      // DC Stop All Effects
      break;
    case 4:
      // DC Device Reset
      break;
    case 5:
      // DC Device Pause
      break;
    case 6:
      // DC Device Continue
      break;
    default:
      break;
    }
    break;
  case 0x0C:
    break;
  case 0x0D:
    USB_Control_Out_Callback(hhid->Report_buf);
    break;
  case 0x0E:
    USB_Wheel_Out_Callback(hhid->Report_buf);
    break;
  default:
    break;
  }
  /* Start next USB packet transfer once data processing is completed */
  if (USBD_CUSTOM_HID_ReceivePacket(&hUsbDeviceFS) != (uint8_t)USBD_OK)
  {
    return -1;
  }

  return (USBD_OK);
  /* USER CODE END 6 */
}

/* USER CODE BEGIN 7 */
/**
 * @brief  Send the report to the Host
 * @param  report: The report to be sent
 * @param  len: The report length
 * @retval USBD_OK if all operations are OK else USBD_FAIL
 */
/*
static int8_t USBD_CUSTOM_HID_SendReport_FS(uint8_t *report, uint16_t len)
{
  return USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, report, len);
}
*/
/* USER CODE END 7 */

/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */

/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */
/**
 * @}
 */

/**
 * @}
 */

/**
 * @}
 */
